<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>排序</title>
	<script type="text/javascript">
        function sort(arr){
            for(var i=0 ; i<arr.length ; i++){
                for(var j=i+1 ; j<arr.length ; j++){
                    if(arr[i]<arr[j]){
                        var change=arr[i];
                        arr[i]=arr[j];
                        arr[j]=change;
                    }
                }
            }
            return arr;
        }
        arr=[122,4,56,8,9,1,4457,456,45,698];
        alert(sort(arr));
	</script>
</head>
<body>
	
</body>
</html>